/*
 * User: Sepheus Angelus
 * Date: 02/03/2008
 * Time: 10:16
 * 
 */

using System;
using System.Security.Cryptography;
using System.Text;

namespace Aphyros_MUD_Server
{
	/// <summary>
	/// Provides a method for MD5 encryption.
	/// </summary>
	public class Encryption
	{
		/// <summary>
		/// Encrypts a given password to an MD5 hash.
		/// </summary>
		/// <param name="Password">The password string.</param>
		/// <returns>An MD5 hash as string.</returns>
		public static string Encrypt(string Password)
		{
			MD5 md5 = new MD5CryptoServiceProvider();	
			return BitConverter.ToString(md5.ComputeHash(ASCIIEncoding.Default.GetBytes(Password))).Replace("-","").ToLower();
		}
	}
}
